/**
 * @author liangxi
 * @since 2023/12/21
 */

#ifndef DESIGNPATTERN_TURKEYADAPTER_H
#define DESIGNPATTERN_TURKEYADAPTER_H


#include <memory>
#include "../Duck.h"
#include "../../Turkey/Turkey.h"

namespace Adapter {

    class TurkeyAdapter : public Adapter::Duck {
    public:
        explicit TurkeyAdapter(const std::shared_ptr<Turkey> &turkey) : turkey(turkey) {}

        void fly() override {
            for (int i = 0; i < 5; ++i) {
                turkey->fly();
            }
        }

        void quack() override {
            turkey->gobble();
        }

    private:
        std::shared_ptr<Adapter::Turkey> turkey;
    };

} // Adapter

#endif //DESIGNPATTERN_TURKEYADAPTER_H
